<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>用户详情</h2>
    </div>
    <div class="tab-wrap">
        <ul class="tab-nav nav">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">基 础</a></li>
        </ul>
        <div class="tab-content">
            <form action="__SELF__" method="post" class="form-horizontal" autocomplete="off">
                <div id="tab1" class="tab-pane in tab1">

                    <div class="form-item cf">
                        <label class="item-label">头像</label>
                        <div class="controls">
                            <input type="file" id="upload_picture_thumb">
                            <input type="hidden" name="avatar_id" id="cover_id_thumb" value="{$info.avatar}"/>
                            <div class="upload-img-box">
                                <notempty name="info.avatar_url">
                                    <div class="upload-pre-item"><img src="{$info.avatar_url}"/></div>
                                </notempty>
                            </div>
                        </div>
                        <script type="text/javascript">
                            //上传图片
                            /* 初始化上传插件 */
                            $("#upload_picture_thumb").uploadify({
                                "height"          : 30,
                                "swf"             : "__STATIC__/uploadify/uploadify.swf",
                                "fileObjName"     : "download",
                                "buttonText"      : "上传图片",
                                "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
                                "width"           : 120,
                                'removeTimeout'	  : 1,
                                'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
                                "onUploadSuccess" : uploadPicture,
                                'onFallback' : function() {
                                    alert('未检测到兼容版本的Flash.');
                                }
                            });
                            function uploadPicture(file, data){
                                var data = $.parseJSON(data);
                                var src = '';
                                if(data.status){
                                    $("#cover_id_thumb").val(data.id);
                                    src = data.url || '__ROOT__' + data.path;
                                    $("#cover_id_thumb").parent().find('.upload-img-box').html(
                                        '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                                    );
                                } else {
                                    updateAlert(data.info);
                                    setTimeout(function(){
                                        $('#top-alert').find('button').click();
                                        $(that).removeClass('disabled').prop('disabled',false);
                                    },1500);
                                }
                            }
                        </script>
                    </div>

                    <div class="form-item">
                        <label class="item-label"> 用户手机</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="username" value="{$info.username}" disabled>
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">用户名称</label>
                        <div class="controls">
                            <input type="text" class="text input-large" name="nickname" value="{$info.nickname}">
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">元宝</label>
                        <div class="controls">
                            {$info.coin}
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">Go币</label>
                        <div class="controls">
                           {$info.amount}
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="label-control">金币转增权限开通：</label>
                        <div class="input-control">
                            <label class="radio"><input type="radio"
                                <eq value="1"  name="info['coin_permissions']">checked=checked</eq>
                                name="coin_permissions" value="1">是</label>
                            <label class="radio"><input type="radio"
                                <eq value="0"  name="info['coin_permissions']">checked=checked</eq>
                                name="coin_permissions" value="0">否</label>
                        </div>
                    </div>
                    <br/>
                </div>
                <div class="form-item">
                    <button class="btn submit-btn ajax-post hidden" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                    <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                    <input type="hidden" name="id" value="{$info.uid}">
                </div>
            </form>
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('shop/manage')}');
        showTab();
    </script>
</block>